package com.movie.theatre.web.exception;

import lombok.Data;

/**
 * @Auther: liwu
 * @Date: 2019/5/14 14:52
 * @Description:
 */
@Data
public class CinemaException extends RuntimeException{


    private int code;
    private String message;
    private boolean isTips;


    public CinemaException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
        this.isTips = true;
    }

    public CinemaException(int code, String message, boolean isTips) {
        super(message);
        this.code = code;
        this.message = message;
        this.isTips = isTips;
    }

    public CinemaException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.message = errorCode.getDesc();
        this.isTips = true;
    }

    public CinemaException(ErrorCode errorCode, boolean isTips) {
        this.code = errorCode.getCode();
        this.message = errorCode.getDesc();
        this.isTips = isTips;
    }

}
